﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Boiling.BizFacade;

namespace Boiling.Web
{
    public partial class AddBlog : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session.Contents["userID"] == null)
            {
                Response.Redirect("default.aspx");
            }
        }
        public void LinkButton_Click(Object sender, EventArgs e)
        {

            if (Session.Contents["userID"] != null)
            {
                Session.Remove("userID");
            }
            Response.Redirect("Default.aspx");
        }

        public void Summit_Click(Object sender, EventArgs e)
        {
            BlogManager m_blog = new BlogManager();

            m_blog.InsertDiary((string)Session.Contents["userID"], this.newTitle.Text, this.newBlog.Text);
            Response.Redirect("myBlog.aspx");
        }      
    }
}
